import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_tutorial/app/data/services/settings_service.dart';
import 'package:getx_tutorial/app/routes/app_pages.dart';

class MinePage extends GetView {

  @override
  Widget build(BuildContext context) {
    var settingsService = Get.find<SettingsService>();
    print('mine_page: '+settingsService.toString());

    return Scaffold(
      appBar: AppBar(
        title: Text(settingsService.title+'-个人中心'),
        centerTitle: true,
      ),

      body: SafeArea(
        child: ListView(
          children: [
            ListTile(
              title: Text('多语言'),
              subtitle: Text('Get.toNamed("/mine/lang")'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.LANG);
              }
            ),
            ListTile(
              title: Text('多主题'),
              subtitle: Text('Get.toNamed("/mine/theme")'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.THEME);
              }
            ),

            ListTile(
              title: Text('GetView'),
              subtitle: Text('Get.toNamed("/mine/getview")'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.GETVIEW);
              }
            ),
            ListTile(
              title: Text('GetResponsiveView'),
              subtitle: Text('Get.toNamed("/mine/getresponsiveview")'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.GETRESPONSIVEVIEW);
              }
            ),
            ListTile(
              title: Text('GetWidget'),
              subtitle: Text('Get.toNamed("/mine/getwidget")'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.GETWIDGET);
              }
            ),
            ListTile(
              title: Text('GetX - API'),
              subtitle: Text('GetX 封装的函数'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.API);
              }
            ),
            ListTile(
              title: Text('GetStorage'),
              subtitle: Text('同步写入内存，备份到硬盘'),
              trailing: Icon(Icons.chevron_right),
              onTap: () {
                Get.toNamed(Routes.MINE+Routes.GETSTORAGE);
              }
            ),
          ],
        )
      )
    );
  }
}